package com.huaxin.device.dto.request;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class ElectricalEquipmentCreateReqDTO {

    @Schema(description = "设备名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "干式变压器T1")
    @NotBlank(message = "设备名称不能为空")
    private String equipmentName;

    @Schema(description = "设备编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "EQP-TR-001")
    @NotBlank(message = "设备编号不能为空")
    private String equipmentCode;

    @Schema(description = "型号ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "m123e456-789a-bcde-f012-3456789abcde")
    @NotBlank(message = "型号ID不能为空")
    private String modelId;

    @Schema(description = "分类ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "c123e456-789a-bcde-f012-3456789abcdf")
    @NotBlank(message = "分类ID不能为空")
    private String categoryId;

    @Schema(description = "安装日期", example = "2023-01-15 09:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @NotNull(message = "安装日期不能为空")
    private LocalDateTime installDate;

    @Schema(description = "生产厂家", example = "ABB中国有限公司")
    private String manufacturer;

    @Schema(description = "出厂序列号", example = "SN2023ABCT1")
    private String serialNumber;

    @Schema(description = "额定电压", example = "10kV/400V")
    private String ratedVoltage;

    @Schema(description = "额定电流（A）", example = "1000")
    private Integer ratedCurrent;

    @Schema(description = "额定容量（kVA/kW）", example = "1000.00")
    private BigDecimal powerRating;

    @Schema(description = "上次维保时间", example = "2025-01-15 10:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastMaintenanceDate;

    @Schema(description = "下次维保时间", example = "2026-01-15 10:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime nextMaintenanceDate;

    @Schema(description = "备注", example = "主变压器，优先级高")
    private String description;

    @Schema(description = "所属配电房ID", example = "r123e456-789a-bcde-f012-3456789abcde")
    private String roomId;

    @Schema(description = "所属变电箱ID", example = "cb123e456-789a-bcde-f012-3456789abcde")
    private String cabinetId;

    @Schema(description = "所属电井ID", example = "w123e456-789a-bcde-f012-3456789abcde")
    private String wellId;

    @Schema(description = "组织ID", example = "org-01")
    private String orgId;

    @Schema(description = "家庭ID", example = "family-01")
    private String familyId;
}